package com.agileboot.domain.system.file.db;

import com.agileboot.common.core.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 系统文件表
 * </p>
 *
 * @author valarchie
 * @since 2025-01-XX
 */
@Getter
@Setter
@TableName("sys_file")
@ApiModel(value = "SysFileEntity对象", description = "系统文件表")
public class SysFileEntity extends BaseEntity<SysFileEntity> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("文件主键")
    @TableId(value = "file_id", type = IdType.AUTO)
    private Long fileId;

    @ApiModelProperty("文件原始名称")
    @TableField("file_name")
    private String fileName;

    @ApiModelProperty("存储key/相对路径")
    @TableField("file_key")
    private String fileKey;

    @ApiModelProperty("文件后缀(如：pdf、jpg)")
    @TableField("file_suffix")
    private String fileSuffix;

    @ApiModelProperty("MIME类型(如：image/png)")
    @TableField("file_type")
    private String fileType;

    @ApiModelProperty("文件大小(字节)")
    @TableField("file_size")
    private Long fileSize;

    @ApiModelProperty("存储类型(local/qiniu/minio等)")
    @TableField("storage_type")
    private String storageType;

    @ApiModelProperty("文件访问URL")
    @TableField("url")
    private String url;

    @ApiModelProperty("业务类型标识(如：performance, avatar)")
    @TableField("biz_type")
    private String bizType;

    @ApiModelProperty("业务主键ID")
    @TableField("biz_id")
    private Long bizId;

    @ApiModelProperty("备注")
    @TableField("remark")
    private String remark;

    @Override
    public Serializable pkVal() {
        return this.fileId;
    }
}

